projects
/
cargo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2dd2ac
)
Filter statuses only by the relevant path
author
Alex Crichton
<alex@alexcrichton.com>
Thu, 25 Jun 2015 06:56:59 +0000
(23:56 -0700)
committer
Alex Crichton
<alex@alexcrichton.com>
Thu, 25 Jun 2015 06:59:03 +0000
(23:59 -0700)
This enables libgit2 to not traverse the majority of the tree, saving a lot of
otherwise unnecessary syscalls.
src/cargo/sources/path.rs
patch
|
blob
|
history
diff --git
a/src/cargo/sources/path.rs
b/src/cargo/sources/path.rs
index 80f9195420a5ed6387601ba3d6479fbdf0906821..0e3668b42b4a2063dad13bdf48fd977b1abfdbd0 100644
(file)
--- a/
src/cargo/sources/path.rs
+++ b/
src/cargo/sources/path.rs
@@
-153,6
+153,9
@@
impl<'cfg> PathSource<'cfg> {
});
let mut opts = git2::StatusOptions::new();
opts.include_untracked(true);
+ if let Some(suffix) = util::without_prefix(pkg_path, &root) {
+ opts.pathspec(suffix);
+ }
let statuses = try!(repo.statuses(Some(&mut opts)));
let untracked = statuses.iter().map(|entry| {
(join(&root, entry.path_bytes()), None)